<?php

namespace app\index\model;

use think\Model;

class Jujian extends Model
{
    // 表名
    protected $table = 'jujian';
    protected $append = [
        'is_toucun',
       'is_geye'
    ];
    protected function getIsToucunAttr($value, $data)
    {
        $value = $value ? $value : $data['toucun_zu_id'];
        $res = ToucunZu::get($value);

        return $res['is_toucun'];
    }
    protected function getIsGeyeAttr($value, $data)
    {
        $value = $value ? $value : $data['toucun_zu_id'];
        $res = ToucunZu::get($value);

        return $res['is_geye'];
    }
}
